package com.zzw.springboot.bean;

import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

public class SupplierEvaluation {
    private Integer evaluationId;

    @NotNull(message = "供应商ID不能为空")
    private Integer supplierId;

    @NotEmpty(message = "评价类型不能为空")
    private String evaluationType; // 季度评价/年度评价/订单评价

    @Range(min = 0, max = 10, message = "质量评分必须在0-10范围内")
    private BigDecimal qualityScore;

    @Range(min = 0, max = 10, message = "交付评分必须在0-10范围内")
    private BigDecimal deliveryScore;

    @Range(min = 0, max = 10, message = "价格评分必须在0-10范围内")
    private BigDecimal priceScore;

    @Range(min = 0, max = 10, message = "服务评分必须在0-10范围内")
    private BigDecimal serviceScore;

    private BigDecimal totalScore;

    private String evaluationPeriod;
    private String evaluator;
    private String remark;
    private Date createTime;

    // 关联的供应商信息（非表字段）
    private Supplier supplier;

    public SupplierEvaluation() {
    }

    public SupplierEvaluation(Integer evaluationId, Integer supplierId, String evaluationType, BigDecimal qualityScore, BigDecimal deliveryScore, BigDecimal priceScore, BigDecimal serviceScore, BigDecimal totalScore, String evaluationPeriod, String evaluator, String remark, Date createTime, Supplier supplier) {
        this.evaluationId = evaluationId;
        this.supplierId = supplierId;
        this.evaluationType = evaluationType;
        this.qualityScore = qualityScore;
        this.deliveryScore = deliveryScore;
        this.priceScore = priceScore;
        this.serviceScore = serviceScore;
        this.totalScore = totalScore;
        this.evaluationPeriod = evaluationPeriod;
        this.evaluator = evaluator;
        this.remark = remark;
        this.createTime = createTime;
        this.supplier = supplier;
    }

    public Integer getEvaluationId() {
        return evaluationId;
    }

    public void setEvaluationId(Integer evaluationId) {
        this.evaluationId = evaluationId;
    }

    public Integer getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Integer supplierId) {
        this.supplierId = supplierId;
    }

    public String getEvaluationType() {
        return evaluationType;
    }

    public void setEvaluationType(String evaluationType) {
        this.evaluationType = evaluationType;
    }

    public BigDecimal getQualityScore() {
        return qualityScore;
    }

    public void setQualityScore(BigDecimal qualityScore) {
        this.qualityScore = qualityScore;
    }

    public BigDecimal getDeliveryScore() {
        return deliveryScore;
    }

    public void setDeliveryScore(BigDecimal deliveryScore) {
        this.deliveryScore = deliveryScore;
    }

    public BigDecimal getPriceScore() {
        return priceScore;
    }

    public void setPriceScore(BigDecimal priceScore) {
        this.priceScore = priceScore;
    }

    public BigDecimal getServiceScore() {
        return serviceScore;
    }

    public void setServiceScore(BigDecimal serviceScore) {
        this.serviceScore = serviceScore;
    }

    public BigDecimal getTotalScore() {
        return totalScore;
    }

    public void setTotalScore(BigDecimal totalScore) {
        this.totalScore = totalScore;
    }

    public String getEvaluationPeriod() {
        return evaluationPeriod;
    }

    public void setEvaluationPeriod(String evaluationPeriod) {
        this.evaluationPeriod = evaluationPeriod;
    }

    public String getEvaluator() {
        return evaluator;
    }

    public void setEvaluator(String evaluator) {
        this.evaluator = evaluator;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Supplier getSupplier() {
        return supplier;
    }

    public void setSupplier(Supplier supplier) {
        this.supplier = supplier;
    }

    @Override
    public String toString() {
        return "SupplierEvaluation{" +
                "evaluationId=" + evaluationId +
                ", supplierId=" + supplierId +
                ", evaluationType='" + evaluationType + '\'' +
                ", qualityScore=" + qualityScore +
                ", deliveryScore=" + deliveryScore +
                ", priceScore=" + priceScore +
                ", serviceScore=" + serviceScore +
                ", totalScore=" + totalScore +
                ", evaluationPeriod='" + evaluationPeriod + '\'' +
                ", evaluator='" + evaluator + '\'' +
                ", remark='" + remark + '\'' +
                ", createTime=" + createTime +
                ", supplier=" + supplier +
                '}';
    }
}
